﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Data.SqlClient;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;

namespace SGSN
{
    class Program
    {
        public static string filename = @"C:\Users\sona.ghazaryan.FTA\Documents\CDRs\SG01CMD22015060121130300573743.DAT";
        public static string FN = @"C:\Users\sona.ghazaryan.FTA\Documents\Visual Studio 2013\Projects\SGSN\1.xml";
        public static BinaryReader BR;

        static void Main(string[] args)
        {
            int lenght = 490;
            Read read = new Read();
            using (FileStream stream = new FileStream(filename, FileMode.Open))
            {
                BR = new BinaryReader(stream);
                for (int loop = 0; loop < lenght; loop++)
                {
                    stream.Seek(loop * lenght, SeekOrigin.Begin);
                    Console.WriteLine(read.Readf(BR, lenght, loop, "sgsnErrorCause"));
                }
            }
        }

    }
}